{include file="public/header"}

<div class="wrapper wrapper-content animated fadeInRight">

    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>操作日志列表</h5>
        </div>
        <div class="ibox-title">
            <!--搜索框开始-->

            <form id='commentForm' role="form" method="post" class="form-inline ">

                <div class="content clearfix m-b">
                    <div class="form-group">
                        <input id="start_date" style="background: #fff" readonly name="start_date" value="{$start_date ? $start_date : '' ;}"
                               class=" form-control input-sm  laydate-icon" placeholder="起始日期">
                    </div>
                    <div class="form-group">
                        <input id="end_date" style="background: #fff" readonly name="end_date" value="{$end_date ? $end_date : '' ;}"
                               class=" form-control input-sm " placeholder="截止日期">
                    </div>
                    <div class="form-group">
                        <select name="user_id" class="form-control input-sm">
                            <option value="-1">选择用户</option>
                            {foreach name="user_list" item="user"}
                            <option value="{$user.id}" {if isset($user_id)&&
                                    $user_id==$user.id}selected{/if}>{$user.nickname}({$user.name})
                            </option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="form-group">
                        <input value="{$title ? $title : '' ;}"
                               name="title" id="title" class="form-control input-sm" placeholder="操作名称">
                    </div>
                    <div class="form-group">
                        <button class="btn btn-primary btn-sm" type="submit"><i class="fa fa-search"></i> 查询
                        </button>
                    </div>
                    <div class="form-group">
                        <button onclick="clear_form()" class="btn btn-default btn-sm" type="button"><i
                                class="fa  fa-eraser"></i> 清空查询
                        </button>
                    </div>
                    <div class="form-group">
                        <button onclick="exportData()" class="btn btn-sm btn-default" type="button"><i class="fa fa-download"></i> 导出
                        </button>
                    </div>

                </div>

            </form>

            <!--  <form class="form-inline" name="searchForm" id="searchForm" action="" method="post">
                  <div class="form-group">
                      <input id="start_date" style="background: #fff" readonly name="start_date" value="{$start_date ? $start_date : '' ;}"
                             class=" form-control input-sm" placeholder="起始日期">
                  </div>
                  <div class="form-group">
                      <input id="end_date" style="background: #fff" readonly name="end_date" value="{$end_date ? $end_date : '' ;}"
                             class=" form-control input-sm " placeholder="截止日期">
                  </div>
                  <div class="form-group">
                      <select name="user_id" class="form-control input-sm">
                          <option value="-1">选择用户</option>
                          {foreach name="user_list" item="user"}
                          <option value="{$user.id}" {if isset($user_id)&&
                                  $user_id==$user.id}selected{/if}>{$user.nickname}({$user.name})
                          </option>
                          {/foreach}
                      </select>
                  </div>
                  <div class="form-group">
                      <input value="{$title ? $title : '' ;}"
                             name="title" id="title" class="form-control input-sm" placeholder="操作名称">
                  </div>
                  <div class="form-group">
                      <button class="btn btn-primary btn-sm" type="submit"><i class="fa fa-search"></i> 查询
                      </button>
                  </div>
                  <div class="form-group">
                      <button onclick="clear_form()" class="btn btn-default btn-sm" type="button"><i
                              class="fa  fa-eraser"></i> 清空查询
                      </button>
                  </div>
              </form>-->
        </div>
        <div class="ibox-content">


            <!--搜索框结束-->
            <div class="ibox-content">

                <table class="table table-striped table-bordered table-hover dataTables-example">
                    <thead>
                    <tr>
                        <th>ID	</th>
                        <th>用户名	</th>
                        <th>操作</th>
                        <th>URL</th>
                        <th>请求方式</th>
                        <th>IP	</th>
                        <th>日期</th>
                        <th>操作
                        </th>
                    </tr>
                    </thead>

                    <tbody>
                    {foreach name='list' item='list'}
                    <tr class="gradeX">
                        <td>{$list.id}</td>
                        <td>{$list->adminuser['name']}</td>
                        <td>{$list.title}</td>
                        <td>{$list.log_url}</td>
                        <td>{$list.log_type}</td>
                        <td>{$list.log_ip}</td>
                        <td>{$list.create_time}</td>
                        <td class="td-do">
                            <a href="edit.html?id={$list.id}"
                               class="btn btn-primary btn-xs" title="修改" data-toggle="tooltip">
                                <i class="fa fa-pencil"></i>
                            </a>
                            <a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="删除" data-id="{$list.id}" data-url="del.html">
                                <i class="fa fa-trash"></i>
                            </a>
                        </td>
                    </tr>

                    {/foreach}
                    </tbody>
                </table>
                {include file="template/data_footer" /}
            </div>
        </div>
    </div>


</div>



{include file="public/footer"}
<script>
    var start = {
        elem: '#start_date',
        format: 'YYYY-MM-DD',
        min: '2000-01-1', //设定最小日期为当前日期
        max: '2099-06-16', //最大日期
        istime: false,
        istoday: false,
        choose: function(datas){
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end_date',
        format: 'YYYY-MM-DD',
        min: '2000-01-1',
        max: '2099-06-16',
        istime: false,
        istoday: false,
        choose: function(datas){
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
</script>

</html>

